import React from "react";
import "./Header.css";
class Header extends React.Component {
  state = {};

  render() {
    let { toparr, sychange } = this.props;
    return (
      <div className="header">
        <ul>
          {toparr.map((item, index) => {
            return (
              <li
                key={index}
                className={item.checked ? "activeH" : null}
                onClick={sychange(index)}
              >
                {item.title}
              </li>
            );
          })}
        </ul>
      </div>
    );
  }
}

export default Header;
